package com.just.fun.crazyThread;

/**
 * Created by han.yuan
 * 2018/4/7
 * 测试join方法
 */
public class TestJoin {
    public static void main(String[] args){
        Runnable runnable=new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName()+"执行完成！");
            }
        };
        Thread t1=new Thread(runnable,"T1");
        Thread t2=new Thread(runnable,"T2");
        Thread t3=new Thread(runnable,"T3");
        try {
            t1.start();
            t1.join();
            t2.start();
            t2.join();
            t3.start();
            t3.join();
        }catch (InterruptedException e){
            e.printStackTrace();
        }


    }
}
